import React from 'react'
import {useSelector,useDispatch} from 'react-redux'
import {incrAction} from '@/store/actions/counterAction'
export default function Counter1() {
  const count=useSelector((state)=>{
    return state.counterKey.count
  })   
  const disptch=useDispatch()
  return (
    <div>
        <h1>redux-hook版本的计数器</h1>
        <div onClick={()=>{
            disptch(incrAction(3))
        }}>{count}</div>
    </div>
  )
}
